<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('法律条文列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li class="select-time">
                            <label>录入时间：</label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginCreateDate]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endCreateDate]"/>
                        </li>
                        <li>
                            <label>标题：</label>
                            <input type="text" name="title"/>
                        </li>

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('publish:provisions:edit')}]];
    var removeFlag = [[${@permission.hasPermi('publish:provisions:remove')}]];
    var prefix = ctx + "publish/provisions";

    $(function () {
        var options = {
            url: prefix + "/list",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            modalName: "法律条文",
            sortName: "createDate",
            sortOrder: "desc",
            columns: [{
                radio: true
            },
                {
                    field: 'id',
                    title: '编号',
                    visible: false
                },
                {
                    field: 'index',
                    align: 'center',
                    title: "序号",
                    formatter: function (value, row, index) {
                        var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
                        return columnIndex + $.table.serialNumber(index);
                    },
                    width: '36'

                },
                {
                    field: 'title',
                    title: '标题',
                    align: 'center',
                    width: '72'

                },
                {
                    field: 'legalContent',
                    title: '法律条文',
                    align: 'center',
                    width: '360'


                },
                {
                    field: 'createDate',
                    title: '录入时间',
                    align: 'center',
                    width: '36'
                },
            ]
        };
        $.table.init(options);
    });

    /* 添加用户-选择用户-提交 */
    function submitHandler(index, layero) {
        // var rows = $.table.selectFirstColumns();
        var rows = $("#bootstrap-table").bootstrapTable('getSelections');
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
        $.modal.close();
        parent.setLegal(rows);
    }
</script>
</body>
</html>